var h = Object.defineProperty, v = Object.defineProperties;
var C = Object.getOwnPropertyDescriptors;
var l = Object.getOwnPropertySymbols;
var y = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
var m = (e, t, o) => t in e ? h(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, f = (e, t) => {
  for (var o in t || (t = {}))
    y.call(t, o) && m(e, o, t[o]);
  if (l)
    for (var o of l(t))
      S.call(t, o) && m(e, o, t[o]);
  return e;
}, u = (e, t) => v(e, C(t));
import { computed as d } from "vue";
import { c as V, k as x, a as P } from "../component-87e22bdd.mjs";
import { c as T } from "../props-c0e5b20d.mjs";
/*!
* Vin UI 移动端 Vue3 组件库 v0.2.9 Fri Jun 02 2023 21:01:02 GMT+0800 (中国标准时间)
* (c) 2023 @vingogo.
* Released under the MIT License.
*/
const j = u(f({}, T), {
  theme: { type: String, default: "" },
  themeVars: { type: Object, default: {} }
}), { create: k, useVinContext: M } = V("config-provider"), E = k({
  props: j,
  setup(e) {
    const { getMainClass: t, getMainStyle: o } = M(e), c = (r) => {
      if (!r)
        return;
      const n = P(r);
      return n ? `${n == null ? void 0 : n.r},${n == null ? void 0 : n.g},${n == null ? void 0 : n.b}` : null;
    }, g = (r) => {
      var i;
      if (!r)
        return {};
      let n = {};
      const a = (i = e == null ? void 0 : e.themeVars) == null ? void 0 : i.primaryColor;
      return a && (n = {
        "--vin-tabs-horizontal-tab-line-color": `linear-gradient(90deg, ${a} 0%, rgba(${c(
          a
        )},0.15) 100%)`,
        "--vin-tabs-vertical-tab-line-color": `linear-gradient(180deg, ${a} 0%, rgba(${c(
          a
        )},0.15) 100%)`
      }), Object.keys(r).forEach((s) => {
        n[`--vin-${x(s)}`] = r[s];
      }), n;
    }, $ = d(() => t({
      [`vin-theme-${e.theme}`]: !!e.theme
    })), b = d(() => o(g(e.themeVars)));
    return {
      classes: $,
      styles: b
    };
  }
});
export {
  E as default
};
